<%@page contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<link href="resources/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"
      type="text/css" />
<script src="resources/ztree/js/jquery.ztree.all-3.5.js"
        type="text/javascript"></script>
<script src="resources/jquery.json-2.3.js" type="text/javascript"></script>
<SCRIPT type="text/javascript">
    <!--
    var setting = {
        callback: {
            onNodeCreated: zTreeOnNodeCreated
        },
        async: {
            enable: true,
            url:"${ctx}/category/asynctree",
            autoParam:["id"],
            otherParam:{"otherParam":"zTreeAsyncTest"},
            dataFilter: filter
        }
    };
    function zTreeOnNodeCreated(event, treeId, treeNode) {
        //如果不是叶子节点
        //if(!treeNode.isParent){
        $("#"+treeNode.tId+"_a").attr("rel","jbsxBox").attr("target","ajax").attr("href","category/tab/"+treeNode.id) ;
        // }
    }
    function filter(treeId, parentNode, childNodes) {
        if (!childNodes) return null;
        for (var i=0, l=childNodes.length; i<l; i++) {
            childNodes[i].target=childNodes[i].target;
            childNodes[i].url=childNodes[i].url;
            childNodes[i].href=   childNodes[i].href;
            alert(childNodes[i].name);

        }
        return childNodes;
    }

    $(document).ready(function(){
        $.fn.zTree.init($("#ztree"), setting);
    });
    //-->
</SCRIPT>
<div class="pageContent" style="padding:5px">
    <div class="tabs">
        <div class="tabsHeader">
            <div class="tabsHeaderContent">
                <ul>
                    <li><a href="javascript:;"><span>产品类别管理</span></a></li>
                </ul>
            </div>
        </div>
        <div class="tabsContent">
            <div>
                <div layoutH="55" style="float:left; display:block; overflow:auto; width:240px; border:solid 1px #CCC; line-height:21px; background:#fff">
                    <ul id="ztree" class="ztree"></ul>
                </div>
                <div id="jbsxBox" class="unitBox" style="margin-left:246px;">
                    <!--#include virtual="list1.html" -->
                </div>
            </div>
        </div>
        <div class="tabsFooter">
            <div class="tabsFooterContent"></div>
        </div>
    </div>
</div>